#include <iostream>
#include "CFileRead.h"
#include "CAsciiFileRead.h"
#include "CBinaryFileRead.hpp"

// test exa: for CAsciiFileRead
void test()
{
    CAsciiFileRead testFile("./data/test.txt", 40);
    CFileRead *pFile = &testFile;
    testFile.skipLines(1);
    pFile->loadAll();
    pFile->Load();
}

// test exa: for CBinaryFileRead
class dataT
{
// public:
//     friend ifstream &operator>>(ifstream &input, const dataT &val)
//     {
//         input.read((char*)&val, sizeof(val));
//         return input;
//     }

public:
    double d1;
    double d2;
    double d3;
    double d4;
};
void test01()
{
    CBinaryFileRead<dataT> testFile("./data/students.dat");
    testFile.loadAll();
    testFile.Load();
}

// ************************main************************* //
int main(int argc, char **argv)
{
    test();
    test01();
    return 0;
}